import React, { useEffect } from 'react'
import '../style/service.css'
import u1372 from '../yjr_image/u1372.png'
import GoodRecommend from './GoodRecommend'
import HotelService from './HotelService'
import Note from './Note'
import { Image } from 'react-vant';

export default React.memo( function Service() {

  useEffect(() => {
    const integralShop = sessionStorage.getItem('integralShop')
    if (integralShop) {
      if ((JSON.parse(integralShop).flag) === true) {
        sessionStorage.setItem('integralShop', JSON.stringify({ flag: false }))
        window.location.reload()
      }
    } else {
      sessionStorage.setItem('integralShop', JSON.stringify({ flag: true }))
    }
  }, [])


  return (
    <div className='box'>
      <div className='header'>
        <div className='image'>
          <Image lazyload src={u1372} />
        </div>
        <h1 className='h1'>LOGO</h1>
        <h2 className='h2'> - 花的少，住的好 - </h2>
        <GoodRecommend />
      </div>
      <div className='body'>
        <div style={{ width: '100%', height: '22rem' }}></div>
        <HotelService />
        <Note />
        <div className='rise'></div>
      </div>
    </div>
  )
})
